home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Developer Connection Student Program
/
ADC Tools Sampler CD Disk 3 1999.iso
/
Documentation
/
Books
/
Learn Java on the Macintosh
/
Learn Java Projects
/
11.03 - paint circle
/
SimpleDraw.java
< prev
next >
Wrap
Text File
|
1996-04-22
|
626b
|
26 lines
/* -------------------------------------------------------------
This applet paints a red circle.
Java's classes: Applet (applet)
Graphics (awt) used for drawing
Color (awt) defines colors
Custom classes: SimpleDraw
------------------------------------------------------------- */
import java.applet.Applet;
import java.awt.*;
public class SimpleDraw extends Applet {
/** Draw a red circle when the applet paints itself. */
public void paint(Graphics g) {
g.setColor(Color.red);
g.fillOval(115, 55, 40, 40); // x = 115, y = 115, radius = 40
}
}